home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / nikit / NIDomain.h < prev    next >
Text File  |  1992-10-29  |  3KB  |  97 lines

  1. /*
  2.     NIDomain.h
  3.     Copyright 1990, NeXT, Inc.
  4.     Originally Written by: Lee Tucker
  5.     Responsibility: Lee Tucker
  6. */
  7.  
  8. #import <objc/Object.h>
  9. #import <netinfo/ni.h>
  10. #import "domain.h"
  11. #import <netdb.h>
  12.  
  13. @interface NIDomain : Object
  14. {
  15.     char *fullPath;     /* the fully qualified domain name */
  16.     char *masterServer;        /* the master server for the domain */
  17.     char *currentServer;    /* the current server to which you are connected */
  18.     char *domainTag;        /* the domain tag */
  19.     id    parentDomain;        /* parent domain object, if it has been opened */
  20.     id    delegate;            /* the delegate of the Domain object */
  21.     char *parentDomainName;    /* the fully qualified name of the parent */
  22.     void *domainHandle;    /* the NetInfo handle to the domain */
  23.     ni_status whatHappened;    /* the last error condition from a NetInfo call */
  24.     BOOL connected;            /* TRUE when a connection is open */
  25.     ni_id    rootDirectory;        /* NetInfo directory ID of the root directory */
  26.     ni_fancyopenargs fancyStuff;    /* arguments for the fancy open call */
  27.     struct sockaddr_in    hostSocket;    /* socket used when querying hostname */
  28.     struct hostent *serverHostEnt;    /* hostent used when querying hostname */
  29.     NXZone *domainZone;
  30.     int    _reservedSpace2;
  31.     int _reservedSpace3;
  32.     int _reservedSpace4;
  33. }
  34.  
  35. /* object methods */
  36. + alloc;
  37. + allocFromZone:(NXZone *)zone;
  38. - init;
  39. - free;
  40. - disconnectFromCurrent;
  41.     /* Keep the object but discard the connection. */
  42.  
  43. /* form the connection between the netinfo domain and the object */
  44. - (ni_status)setConnection:(const char *)domain;
  45.     /* open a connection to the named domain */
  46. - (ni_status)setConnection:(const char *)domain readTimeout:(int)rtime writeTimeout:(int)wtime canAbort:(BOOL)abort mustWrite:(BOOL)write;
  47.     /* open a fancy connection to the named domain */
  48. - (ni_status)setTaggedConnection:(const char *)tag to:(char *)hostname;
  49.     /* open a connection to the netinfod with this tag on that hostname */
  50. - (ni_status)setTaggedConnection:(const char *)tag to:(char *)hostname readTimeout:(int)rtime writeTimeout:(int)wtime canAbort:(BOOL)abort;
  51.     /* open a connection to the netinfod with this tag on that hostname,
  52.         and then set the timeout and retry paramters */
  53.  
  54. /* get data about the current domain */
  55. - (const char *)getFullPath;
  56.     /* returns the full path to the domain */
  57. - (const char *)getMasterServer;
  58.     /* gets the name of the master server for the domain, on error
  59.     it returns a null string */
  60. - (const char *)getCurrentServer;
  61.     /* gets the name of the server you are connect to */
  62. - (const char *)getTag;
  63.     /* gets the name of the domain tag, and returns a NULL string on error */
  64. - (const struct sockaddr_in *)getServerIPAddress;
  65.     /* gets the socket of the server you are connected to */
  66. - (void *)getDomainHandle;
  67.     /* gets the domain handle, can be used for direct calls to netinfo */
  68.     
  69. /* get directories in the current domain */
  70. - (ni_entrylist *)findDirectory:(const char *)parentDir withProperty:(const char *)propToMatch;
  71.     /* returns an initialized list of subdirectories of the pathname in the current domain accompanied with the property list, the caller must free the list */
  72.  
  73. /* delegate related methods */
  74. - setDelegate:anObject;
  75.     /* set the domain's delegate */
  76.  
  77. /* error access method */
  78.  
  79. - (ni_status)lastError;
  80.  
  81.  
  82. @end
  83.  
  84. @interface NIDomainDelegate: Object
  85.  
  86. - domain:sender willCloseBecause:(int)reason;
  87.     /* this message is sent when the domain is about to close.  The reason
  88.         is one of the following:
  89.             Val    Reason
  90.             0    User Requested Closing
  91.     */
  92.  
  93. @end
  94.  
  95.     
  96.  
  97.